package com.example.util;

import java.io.Serializable;

/**
 * 返回信息包装类
 * @param <T>
 */
public class Result<T> implements Serializable {

    private String code;  //状态码
    
    private String message;   //提示信息

    private T data;       //数据

    /**
     * 无参构造
     */
    public Result() {}

    /**
     * 根据code，msg创建一个Resutl
     * @param code
     * @param message
     */
    public Result(String code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 根据code，msg，data创建一个Resutl
     * @param code
     * @param message
     * @param data
     */
    public Result(String code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String msg) {
        this.message = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
